<template>
  <BasicModal
    v-bind="$attrs"
    @register="register"
    title="物资详情"
    :footer="null"
    :width="1000"
    :height="630"
    :canFullscreen="false"
    :destroyOnClose="true"
    wrapClassName="stationPopup"
    @height-change="handleHeightChange"
  >
    <Information :data="state.data" />
  </BasicModal>
</template>

<script lang="ts" setup>
  import { ref, reactive, provide } from 'vue';
  import { BasicModal, useModalInner } from '@gui-pkg/antdcomponents';
  import Information from './information.vue';

  const modalHeightValue = ref(680);
  const state = reactive({
    data: null,
  });

  const [register, { setModalProps }] = useModalInner(async (data) => {
    setModalProps({ confirmLoading: false });
    state.data = data.record;
  });

  // 弹窗高度变化，主要是监听是否点击了全屏
  const handleHeightChange = (height: string) => {
    modalHeightValue.value = height;
  };
  provide('ModalHeightChange', modalHeightValue);

</script>

<style lang="less" rel="stylesheet/less" scoped>

</style>
